import java.util.Scanner;

//题目：给一个不多于5位的正整数，要求：一、求它是几位数，二、逆序打印出各位数字。
public class Test24 {
    public static void main(String[] args) {
        Scanner console = new Scanner(System.in);
        System.out.println("请输入一个不多于5位的正整数：");
        int numb = console.nextInt();
        int a = numb;
        int[] arr = new int[5];
        int i = 0;
        while (a / 10 != 0) {
            arr[i] = a % 10;
            a = a / 10;
            i++;
        }
        arr[i] = a;
        if (numb < 10) {
            System.out.println("它是一位数");
        } else {
            System.out.println("它是" + (i + 1) + "位数");
        }
        System.out.print("逆序打印：");
        for (int j = 0; j <= i; j++) {
            System.out.print(arr[j] + " ");
        }
    }
}
